# include <p18f4550.h>
# include <delays.h>



void main () {ADCON1 = 15;
TRISB=0;
TRISD=0xF0;

PORTD = 1;
if (PORTDbits.RD4 == 1) {PORTB = 1;}
else if (PORTDbits.RD5 == 1) {PORTB = 2;}
   else if (PORTDbits.RD6 == 1) {PORTB = 3;}
     else if (PORTDbits.RD7 == 1) {PORTB = 0;}

PORTD = 2 ;
if (PORTDbits.RD4 == 1) {PORTB = 4;}
  else if (PORTDbits.RD5 == 1) {PORTB = 5;}
   else if (PORTDbits.RD6 == 1) {PORTB = 6;}
     else if (PORTDbits.RD7 == 1) {PORTB = 0;}

PORTD = 4;
if (PORTDbits.RD4 == 1) {PORTB = 7;}
  else if (PORTDbits.RD5 == 1) {PORTB = 8;}
    else if (PORTDbits.RD6 == 1) {PORTB = 9;}
     else if (PORTDbits.RD7 == 1) {PORTB = 0;}

PORTD = 8;
if (PORTDbits.RD4 == 1) {PORTB = *;}
  else if (PORTDbits.RD5 == 1) {PORTB = 0;}
   else if (PORTDbits.RD6 == 1) {PORTB = 0;}
     else if (PORTDbits.RD7 == 1) {PORTB = 0;}
}
